home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 422_03 / xasm.doc < prev   
Encoding:
Text File  |  1994-02-25  |  58.0 KB  |  1,261 lines

  1.     
  2.     
  3.     
  4.     
  5.     
  6.     
  7.     
  8.     
  9.     
  10.     
  11.     
  12.     
  13.     
  14.     
  15.     
  16.     
  17.     
  18.     
  19.     
  20.     
  21.                                       XASM
  22.     
  23.                                 Cross Assemblers
  24.     
  25.                                   Users Guide
  26.     
  27.     
  28.     
  29.     
  30.     
  31.                                   Release 2.2
  32.     
  33.                                Revised 03-Jan-94
  34.     
  35.     
  36.     
  37.     
  38.     
  39.                        Copyright 1983-1994 Dave Dunfield
  40.                               All rights reserved
  41.     XASM Cross Assemblers                                            Page: 1
  42.  
  43.  
  44.     1. INTRODUCTION
  45.     
  46.           This complete XASM package contains cross assemblers  for  several
  47.        popular microprocessors, as well as a number of utility programs:
  48.     
  49.             asm00       - 6800 Assembler
  50.             asm01       - 6801/6802 Assembler
  51.             asm02       - 6502 Assembler
  52.             asm05       - 6805 Assembler
  53.             asm08       - 68HC08 Assember
  54.             asm09       - 6809 Assembler
  55.             asm11       - 68HC11 Assembler
  56.             asm16       - 68HC16 Assembler
  57.             asm51       - 8051/8052 Assembler (also 803x, 873x, 875x)
  58.             asm85       - 8085 Assembler (also 8080, Z80)
  59.             asm86       - 8086 Assembler
  60.             asm96       - 8096 Assembler
  61.             hexfmt      - HEX file manipulator
  62.             macro       - Macro pre-processor
  63.             cref        - Cross reference utility
  64.             psource     - Porting source generator
  65.             int2xasm    - Convert "Intel" style source to XASM style
  66.             xasm2int    - Convert XASM style source in "Intel" style
  67.     
  68.           The XASM "package" (software and  documentation)  is  copyrighted,
  69.        and may not be re-distributed without my written permission.  If  you
  70.        find XASM useful, please help me continue to support and  enhance  it
  71.        by ordering the complete package using the order form in the enclosed
  72.        CATALOG file.
  73.     
  74.           XASM is provided on an "as is" basis,  with  no  warranty  of  any
  75.        kind. In no event shall the author be liable for any damages  arising
  76.        from its use or distribution.
  77.     
  78.           Throughout this document, angle braces ('<>') are used to indicate
  79.        operands for which a value must  be  supplied  by  the  user.  Square
  80.        braces ('[]') are used to identify operands which are optional.
  81.     XASM Cross Assemblers                                            Page: 2
  82.  
  83.  
  84.     2. ASSEMBLERS
  85.     
  86.           All of the cross assemblers read a source file (.ASM), and produce
  87.        a code  file  (.HEX)  containing  either  MOTOROLA  or  INTEL  format
  88.        ASCII-HEX download records. A optional listing file (.LST)  may  also
  89.        be produced.
  90.     
  91.        2.1 Using the assemblers
  92.     
  93.              Any assembler is invoked by entering its name  at  the  command
  94.           prompt, in the following format:
  95.     
  96.                            ASMxx <filename> [options]
  97.     
  98.              The <filename> operand is the name of the file to be assembled,
  99.           it is assumed to have the extension ".ASM" if none is supplied.
  100.     
  101.              Unless otherwise specified, the code produced by the  assembler
  102.           is written to a file  with  the  name  '<filename>.HEX',  and  the
  103.           listing is written to a file with the name '<filename>.LST'.
  104.     
  105.           2.1.1 Command line options
  106.     
  107.                 The following options may be specified on the command  line,
  108.              following the <filename> operand:
  109.     
  110.              -C - [C]ase sensitive
  111.     
  112.                      Causes the assembler  to  make  a  distinction  between
  113.                   upper and lower case characters in symbol  names,  thereby
  114.                   allowing you to have multiple symbol  names  which  differ
  115.                   only in case. If this options is not used,  the  assembler
  116.                   will ignore such case differences,  and  assume  that  the
  117.                   symbols are the same. NOTE: When using this  options,  you
  118.                   must enter any register names in UPPER case.
  119.     
  120.              C=<filename> - Specify [C]ode file
  121.     
  122.                      This option allows you to specify the file to which the
  123.                   output code is written. If no  extension  is  supplied  as
  124.                   part of <filename>, it defaults to ".HEX".
  125.     
  126.              -F - Generate [F]ull listing
  127.     
  128.                      Causes the assembler to output a full source listing to
  129.                   the '.LST' file. By default, only lines containing  errors
  130.                   are written to the listing file.
  131.     
  132.              -I - Generate [I]ntel format HEX file
  133.     
  134.                      Causes the assembler to output the code to  the  '.HEX'
  135.                   file in INTEL hex format. By default the code  is  written
  136.                   to the file in MOTOROLA hex format.
  137.     XASM Cross Assemblers                                            Page: 3
  138.  
  139.  
  140.              L=<filename> - Specify [L]isting file
  141.     
  142.                      This option allows you to specify the file to which the
  143.                   listing is written. If no extension is supplied as part of
  144.                   <filename>, it defaults to ".LST".
  145.     
  146.              O=<value> - [O]ptimization (ASM00,01,02,05,08,09,11,16 and 96)
  147.     
  148.                      This option allows you to set a limit  to  the  maximum
  149.                   number of optimization passes  which  the  assembler  will
  150.                   perform while attempting to minimize code size and resolve
  151.                   forward  referenced  symbols.  If  a  symbol  can  not  be
  152.                   resolved within  this  many  passes,  the  assembler  will
  153.                   terminate with an error message.
  154.     
  155.                      You may specify between 0 and 127  optimization  passes
  156.                   to be run, with  0  being  a  special  case  in  which  no
  157.                   optimization  is  performed.  Without  optimization,   all
  158.                   non-specified memory references  and  offsets  default  to
  159.                   their largest form, and forward references in EQU, ORG, or
  160.                   RMB statements will not work. The code generated will  not
  161.                   be optimal, but assembly time is reduced. This feature  is
  162.                   most useful when initialy testing and debugging a program.
  163.     
  164.                      The default number of optimization passes allowed is 3.
  165.     
  166.              P=<length> - Set page length
  167.     
  168.                      This options specifies the number of lines  which  will
  169.                   be printed on each page. The default number of  lines  per
  170.                   page is 60.
  171.     
  172.              -Q - [Q]uiet mode
  173.     
  174.                      Causes  the  assembler  to  be  quiet,  inhibiting  the
  175.                   display of the progress messages.
  176.     
  177.              -S - Generate [S]ymbol table
  178.     
  179.                      Causes the assembler to sort  and  display  the  symbol
  180.                   table at the end of the  listing  file.  By  default,  the
  181.                   symbol table is not displayed.
  182.     
  183.              -T - Output to [T]erminal
  184.     
  185.                      Causes the assembler  to  output  the  listing  to  the
  186.                   terminal, (via stdout) instead of the usual '.LST' file.
  187.     
  188.         W=<width> - Set page width
  189.     
  190.                 This options control the number of  columns  which  will  be
  191.              used for the printing of  page  titles  and  the  symbol  table
  192.              listing. Default page width is 80 columns.
  193.     XASM Cross Assemblers                                            Page: 4
  194.  
  195.  
  196.        2.2 Redirecting the listing file
  197.     
  198.              When the listing file is directed to the terminal with the '-t'
  199.           option on the command line, it is displayed through  the  standard
  200.           output file, allowing it to be redirected to a  printer  etc.  via
  201.           the shell '>' redirection  operator  (EG:  ASMxx  filename  -f  -t
  202.           >LPT1:). The progress messages ('First pass...'  etc)  are  output
  203.           through stderr, and will therefore  not  be  redirected  with  the
  204.           listing.
  205.     
  206.        2.3 Source file format
  207.     
  208.              The assembly source input lines are in the following format:
  209.     
  210.                 '<label>  <instruction>  <operands>  <comment>'
  211.     
  212.              Labels must begin in column one, and must be separated from the
  213.           instruction field by at least one blank or tab character.
  214.     
  215.              If the an instruction or directive requires operands, then  the
  216.           operand field is required, and is separated from  the  instruction
  217.           by at least one blank or tab.
  218.     
  219.              The optional comment field is delimited from the operand  field
  220.           by at least one blank or tab, and is  ignored  by  the  assembler.
  221.           Blanks or tabs within  the  operand  field  are  allowed  only  if
  222.           contained within the delimiters of a character  string,  otherwise
  223.           they will be interpreted as the end of the operand field.
  224.     
  225.              Any lines beginning with a '*'  character  is  column  one  are
  226.           considered to  be  a  comments,  and  are  not  processed  by  the
  227.           assembler.
  228.     XASM Cross Assemblers                                            Page: 5
  229.  
  230.  
  231.        2.4 Expressions
  232.     
  233.              When an 8 or 16 bit value is  required  as  an  operand  to  an
  234.           assembler directive or an instruction, either a simple  value,  or
  235.           an expression consisting of simple values  and  operators  may  be
  236.           used.
  237.     
  238.              All expressions are evaluated using  16  bit  values.  When  an
  239.           expression is evaluated in an instruction requiring an  eight  bit
  240.           value, the lower eight bits are used.  Expressions  are  evaluated
  241.           from left to right,  as  each  operator  is  encountered,  without
  242.           precedence. Precedence can be forced with  the  use  of  brackets.
  243.           Spaces or tabs are not allowed within an expression,  unless  they
  244.           are contained within a character string.
  245.     
  246.              The following operators may be used in an expression:
  247.     
  248.        2.4.1 Unary (one operand) operators:
  249.        
  250.                -   - Negation, returns the negative of the next value.
  251.                ~   - Complement, returns one's complement of the value.
  252.                =   - Swaps the high and low bytes of the next value.
  253.        
  254.        2.4.2 Binary (two operand) operators:
  255.        
  256.                +   - Addition.
  257.                -   - Subtraction.
  258.                *   - Multiplication.
  259.                /   - Division (unsigned).
  260.                \   - Modulus, returns remainder after division.
  261.                &   - Bitwise AND.
  262.                |   - Bitwise OR.
  263.                ^   - Bitwise EXCLUSIVE OR.
  264.                <   - Shift left
  265.                >   - Shift right
  266.        
  267.        
  268.        2.4.3 Values in expressions
  269.        
  270.              The following forms of simple values may be used.
  271.        
  272.              nnn     -  Decimal number, eg: 21
  273.              $hhh    -  Hexidecimal number, eg: $15
  274.              %bbb    -  Binary number, eg: %10101
  275.              @ooo    -  Octal number, eg: @177
  276.              'cc'    -  ASCII characters, eg: 'A'
  277.              <label> -  Value of a label from symbol table.
  278.              *       -  Value of current program counter.
  279.     XASM Cross Assemblers                                            Page: 6
  280.  
  281.  
  282.        2.5 Addressing Modes
  283.     
  284.              The  assemblers  support  all  addressing   modes   for   their
  285.           respective processors and will determine the type of addressing to
  286.           use from the instruction and/or its operands.
  287.     
  288.              For cases where different  sized  offsets  are  available,  the
  289.           assemblers will always use the smallest (most  efficent)  form  of
  290.           the offset unless assembling in 'debug' mode  in  which  case  the
  291.           largest offset will be used.
  292.     
  293.           2.5.1 Immediate addressing
  294.     
  295.                 For all assemblers except ASM85, the operand  is  determined
  296.              to be an immediate value if it is preceeded  by  a  pound  sign
  297.              ('#'). For instructions requiring  only  8  bits  of  immediate
  298.              data, the lower eight bits of  the  value  will  be  used.  The
  299.              higher 8 bits of a value can be accessed by preceeding it  with
  300.              '=' (swapping high and low bytes).
  301.     
  302.                 The '#' character is  NOT  used  with  immediate  values  in
  303.              ASM85, because the immediate addressing context is inherent  in
  304.              the instruction.
  305.     
  306.           2.5.2 Direct/Extended addressing
  307.     
  308.                 For assemblers supporting direct addressing (ASM00, 01,  02,
  309.              05, 08, 09 and 11), the operand is determined to be a DIRECT (8
  310.              bit) address if it is preceeded by a left angle bracket  ('<').
  311.              For ASM00, 01, 02, 05 and 11 this will refrence a value in  the
  312.              "zero" page of  memory  ($0000-$00FF).  For  ASM09,  this  will
  313.              reference a value in the memory page indicated  by  the  Direct
  314.              Page (DP) register.
  315.     
  316.                 An operand is determined to be an ABSOLUTE or  EXTENDED  (16
  317.              bit) address if it is preceeded by a right angle bracket ('>').
  318.     
  319.                 If no addressing mode is explicitly specified, the  assmbler
  320.              will use DIRECT addressing if (ASM00, 01, 02, 05, 08,  11:  the
  321.              value is less than $0100) or  (ASM09:  The  high  byte  of  the
  322.              values matches the last SETDP)  otherwise  ABSOLUTE  addressing
  323.              will be used.
  324.     
  325.           2.5.3 Indirect addressing
  326.     
  327.                 For processors supporting indirection  of  other  addressing
  328.              modes, this is indicated by placing the addressing reference in
  329.              square braces ('[]').
  330.     
  331.                 In ASM02, indexed indirect addressing off  of  'X'  must  be
  332.              specified using square braces around the  entire  operand  (Eg:
  333.              '[10,X]'). Indirect indexed addressing off of 'Y' is  specified
  334.              by enclosing the offset value in square braces (Eg: '[10],Y').
  335.     XASM Cross Assemblers                                            Page: 7
  336.  
  337.  
  338.           2.5.4 ASM11 Bit addressing
  339.     
  340.                 In ASM11, for the BCLR, BSET, BRCLR and BRSET  instructions,
  341.              the bit mask is separated from the address by a ';'.
  342.     
  343.                     eg:     BCLR    MEMLOC;$01
  344.                             BSET    1,X;$02
  345.                             BRCLR   MEMLOC;$01,LABEL
  346.                             BRSET   2,Y;$02,LABEL
  347.     XASM Cross Assemblers                                            Page: 8
  348.  
  349.  
  350.        2.6 Assembler directives
  351.     
  352.              The following directives (pseudo instructions) are supported by
  353.           all of the assemblers:
  354.     
  355.           <label> EQU <expression>
  356.     
  357.              This directive sets the label on it's line to have the value of
  358.           the operand expression.
  359.     
  360.           ORG <expression>
  361.     
  362.              This directive sets the internal program counter to  the  value
  363.           of the operand expression,  such  that  subsequent  code  will  be
  364.           generated at that address.
  365.     
  366.           TITLE <string value>
  367.     
  368.              This directive sets the title of the program to the text on the
  369.           remainder of the line. The title is displayed at the top  of  each
  370.           page in the listing, and by default is set to the name of the file
  371.           being assembled. Lines containing this directive will  not  appear
  372.           in the listing.
  373.     
  374.           PAGE
  375.     
  376.              This directive forces  a  page  eject  in  the  listing.  Lines
  377.           containing this directive will not appear in the listing.
  378.     
  379.           SPACE
  380.     
  381.              This directive causes a blank line to appear  in  the  listing.
  382.           Lines containing this directive will not appear in the listing.
  383.     
  384.           NOLIST
  385.     
  386.              This directive turns off the  source  listing,  preventing  any
  387.           further lines from being displayed,  until  a  LIST  directive  in
  388.           encountered. NOLIST and LIST may be  nested,  listing  is  resumed
  389.           only when all levels of NOLIST have  been  turned  off.  Lines  in
  390.           which errors occur are listed regardless of the NOLIST directive.
  391.     
  392.           LIST
  393.     
  394.              Re-enables output listing, following a NOLIST directive.
  395.     
  396.     XASM Cross Assemblers                                            Page: 9
  397.  
  398.  
  399.           2.6.1 Directives for ASM00, 01, 02, 05, 08, 09, 11 and 16 Only
  400.     
  401.                 The following directives (pseudo instructions) are supported
  402.              by ASM00, ASM01, ASM02, ASM05, ASM08, ASM09,  ASM11  and  ASM16
  403.              only:
  404.     
  405.              FCB <expr1>[,<expr2>,<expr3>,...]
  406.     
  407.                 This directive codes the values of the  operand  expressions
  408.              into memory as single byte constants.
  409.     
  410.              FDB <expr1>[,<expr2>,<expr3>,...]
  411.     
  412.                 This directive codes the values of the  operand  expressions
  413.              into memory as double byte constants.
  414.     
  415.              RDB <expr1>[,<expr2>,<expr2>,...]
  416.     
  417.                 This directive is similar to FDB, except that the  high  and
  418.              low bytes of the coded values are exchanged.
  419.     
  420.              RMB <expression>
  421.     
  422.                 This directive reserves a number of bytes of memory equal to
  423.              the value of  the  operand  expression.  The  contents  of  the
  424.              reserved storage is undefined.
  425.     
  426.              FCC 'text string'
  427.     
  428.                 This directive codes the string into memory  as  ASCII  byte
  429.              values. The string may be delimited by any character  which  is
  430.              not part of the string text.
  431.     
  432.              FCCH 'text string'
  433.     
  434.                 This directive performs  exactly  as  the  'FCC'  directive,
  435.              except that the high bit is set on the last  character  in  the
  436.              string.
  437.     
  438.              FCCZ 'text string'
  439.     
  440.                 This directive performs  exactly  as  the  'FCC'  directive,
  441.              except that the string has a zero byte ($00) appended.
  442.     XASM Cross Assemblers                                            Page: 10
  443.  
  444.  
  445.           2.6.2 Directives for ASM09 Only
  446.     
  447.                 The following directive is supported by ASM09 only:
  448.     
  449.              SETDP <expression>
  450.     
  451.                 This directive sets ASM09's default direct page register  to
  452.              the eight bit value of <expression>. Whenever  a  reference  is
  453.              made to a  memory  location  by  address,  without  a  specific
  454.              addressing mode, the assembler will  use  extended  addressing,
  455.              unless the high byte of the memory address matches the contents
  456.              of ASM09's default direct page register. If this occurs, direct
  457.              page addressing will be used instead. It is the  responsibility
  458.              of the programmer to insure that the 6809 direct page  register
  459.              will contain  the  proper  high  address  value  during  memory
  460.              references subsequent to a 'SETDP' directive. If the  value  of
  461.              <expression> is greater than 255, or less than 0,  the  default
  462.              direct page register will  be  disabled,  and  all  unspecified
  463.              memory  references  will  use  extended  addressing.   At   the
  464.              beginning of an assembly, the default direct page  register  is
  465.              initialized to -1, and is therefore  disabled.  Note  that  the
  466.              high byte of an address label can be referenced  as  an  8  bit
  467.              value by using the '=' prefix, and anding with 255. (eg:  SETDP
  468.              255&=LABEL).
  469.     XASM Cross Assemblers                                            Page: 11
  470.  
  471.  
  472.           2.6.3 Directives for ASM51, 85, 86 and 96 Only
  473.     
  474.                 The following directives (pseudo instructions) are supported
  475.              by ASM51, ASM85, ASM86 and ASM96 only:
  476.     
  477.              DB <expr1>[,<expr2>,<expr3>,...]
  478.     
  479.                 This directive codes the values of the  operand  expressions
  480.              into memory as single byte constants.
  481.     
  482.              DW <expr1>[,<expr2>,<expr3>,...]
  483.     
  484.                 This directive codes the values of the  operand  expressions
  485.              into memory as double byte constants.
  486.     
  487.              DRW <expr1>[,<expr2>,<expr3>,...]
  488.     
  489.                 This directive is similar to DW, except that  the  high  and
  490.              low bytes of the coded values are exchanged.
  491.     
  492.              DS <expression>
  493.     
  494.                 This directive reserves a number of bytes of memory equal to
  495.              the value of  the  operand  expression.  The  contents  of  the
  496.              reserved storage is undefined.
  497.     
  498.              STR 'text string'
  499.     
  500.                 This directive codes the string into memory  as  ASCII  byte
  501.              values. The string may be delimited by any character  which  is
  502.              not part of the string text.
  503.     
  504.              STRH 'text string'
  505.     
  506.                 This directive performs  exactly  as  the  'STR'  directive,
  507.              except that the high bit is set on the last  character  in  the
  508.              string.
  509.     
  510.              STRZ 'text string'
  511.     
  512.                 This directive performs  exactly  as  the  'STR'  directive,
  513.              except that the string has a zero byte ($00) appended.
  514.     XASM Cross Assemblers                                            Page: 12
  515.  
  516.  
  517.        2.7 Error Messages
  518.     
  519.              When the assembler detects an error  in  the  source  code,  it
  520.           displays a message indicating a possible cause of  the  error,  in
  521.           the source listing on the  line  immediately  following  the  line
  522.           containing the error. Errors which are encountered  in  the  first
  523.           pass, are displayed at the top of  the  listing,  along  with  the
  524.           number of the line in which the error was detected.
  525.     
  526.              Forward  references  in  any  of  the  (EQU,  ORG,  or  RMB/DS)
  527.           directives are not allowed, and will cause an  'Undefined  symbol'
  528.           error in the first pass only, displayed at the top of the listing.
  529.     XASM Cross Assemblers                                            Page: 13
  530.  
  531.  
  532.        2.8 Error message summary
  533.     
  534.     Message#                       Message and description.
  535.     --------+--------------------------------------------------------------
  536.       N/A   |               Duplicate symbol: <symbol name>
  537.             |   The indicated symbol is defined more that once within  this
  538.             | assembly.
  539.     --------+--------------------------------------------------------------
  540.       N/A   |                   Symbol table overflow.
  541.             |   There are too many symbols (labels) in the program, and the
  542.             | assemblers symbol table has become full.
  543.     --------+--------------------------------------------------------------
  544.       N/A   |               Unable to resolve: <symbol name>
  545.             |   The assembler is unable to determine a consistant value for
  546.             | the indicated symbol. This is most likely  due  to  excessive
  547.             | forward referencing, or a self referencing loop.
  548.     --------+--------------------------------------------------------------
  549.         1   |                   Unknown instruction
  550.             |   The instruction  field  on  the  indicated  line  does  not
  551.             | contain a valid instruction or assembler directive.
  552.     --------+--------------------------------------------------------------
  553.         2   |                       Out of range
  554.             |   The operand is not the range of values which  can  be  used
  555.             | with the instruction. eg: A short branch to an address  which
  556.             | is farther than +127 or -128 bytes from the program counter.
  557.     --------+--------------------------------------------------------------
  558.         3   |                   Invalid addressing mode
  559.             |   The addressing mode indicated by the operand field  of  the
  560.             | indicated line does not apply to the instruction on that line.
  561.     --------+--------------------------------------------------------------
  562.         4   |                Invalid register specification
  563.             |   The instruction on the indicated line specifies a  register
  564.             | which is not a recognized register,  or cannot be used in the
  565.             | context specified by the instruction.
  566.     --------+--------------------------------------------------------------
  567.         5   |                      Undefined symbol
  568.             |   A symbol referenced in the indicated line  is  not  defined
  569.             | anywhere within this assembly, and has no value.
  570.     --------+--------------------------------------------------------------
  571.         6   |                Invalid expression syntax
  572.             |   The expression on the indicated line contains  a  character
  573.             | which is not recognized as a valid operator.
  574.     --------+--------------------------------------------------------------
  575.         7   |                  Invalid argument format
  576.             |   The indicated line has an operand which is  not  in  proper
  577.             | format.
  578.     --------+--------------------------------------------------------------
  579.         8   |                 Improperly delimited string
  580.             |   A character string constant on the indicated line does  not
  581.             | have a proper closing delimiter. This is normally the  single
  582.             | quote character, but may be another character in  conjunction
  583.             | with the FCC, FCCH, FCCZ, STR, STRH or STRZ directives.
  584.     -----------------------------------------------------------------------
  585.     XASM Cross Assemblers                                            Page: 14
  586.  
  587.  
  588.        2.9 Additional notes on ASM86
  589.     
  590.              The 8086 assembly language was the most difficult to  adapt  to
  591.           the generic syntax used throughout the XASM package. To accomodate
  592.           doing this, a few extensions and changes were made:
  593.     
  594.              In  addition  to  '*',  ASM86  recognizes  ';'  as  a   comment
  595.           character. The RETF instruction is unique in that its  operand  is
  596.           optional, and thus you  must  use  ';'  to  indicate  any  comment
  597.           following RETF without operands. No special comment  delimiter  is
  598.           required for any other instruction.
  599.     
  600.              Symbols are used only to reference addresses, no information is
  601.           recorded as to the size  of  the  symbol.  At  least  one  of  the
  602.           operands to an instruction must contain an explicit size (8 or  16
  603.           bits). The assembler knows the the size of the registers, and thus
  604.           any instructions involving registers will  automatically  use  the
  605.           correct size. For instructions which do not  reference  registers,
  606.           you can force one of the arguments to be recognized as an 8 or  16
  607.           bit value by using the '<' or '>' character as a prefix:
  608.     
  609.                 MOV     AL,DATA     Moves 8 bits
  610.                 MOV     AX,DATA     Moves 16 bits
  611.                 MOV     DATA,#12    ERROR: "Size not known"
  612.                 MOV     <DATA,#12   Moves 8 bits
  613.                 MOV     DATA,#<12   Equivalent to above
  614.                 MOV     >DATA,#12   Moves 16 bits
  615.                 MOV     DATA,#>12   Equivalent to above
  616.                 MOV     <DATA,#>12  ERROR: "Incompatible sizes"
  617.     
  618.              The '>' and '<' prefix's also have special meaning in  JMP  and
  619.           CALL instructions:
  620.     
  621.                 JMP     label       NEAR 16 bit RELATIVE jump
  622.                 JMP     <label      NEAR 8 bit RELATIVE jump
  623.                 JMP     >LABEL      NEAR INDIRECT jump through LABEL
  624.                 JMP     BX          NEAR Jump to address in BX
  625.                 JMP     [BX]        NEAR INDIRECT Jump through BX
  626.                 JMP     SEG:LABEL   FAR DIRECT jump
  627.                 JMP     SEG:>LABEL  FAR INDIRECT jump *
  628.                 JMP     SEG:[BX]    FAR INDIRECT jump *
  629.             * In the last two examples, the SEG value is ignored, and
  630.               the SEGMENT:OFFSET is taken from the operand address.
  631.     
  632.              Offsets  to  indirect  accesses  are  specified  by  placing  a
  633.           constant value immediatly before the opening '['. When both a BASE
  634.           and an INDEX register are involved, use '+' to indicate them:
  635.     
  636.                 MOV     AX,[BX]     Indirect through BX, no offset
  637.                 MOV     AX,[SI]     Indirect through SI, no offset
  638.                 MOV     AX,10[DI]   Indirect to DI with 10 byte offset
  639.                 MOV     AX,[BP+SI]  Indirect through BP+SI, no offset
  640.                 MOV     AX,5[BP+SI] Indirect thought BP+SI, 5 byte offset
  641.                 MOV     AX,[BX+10]  This MASM syntax NOT supported!!!
  642.     
  643.              The REPEAT and LOCK prefix's are implemented  as  instructions,
  644.           which must preceed the target instruction on a separate line.
  645.     XASM Cross Assemblers                                            Page: 15
  646.  
  647.  
  648.     3. MACRO PREPROCESSOR
  649.     
  650.           MACRO is an assembly  source  code  pre-processor  which  provides
  651.        macro substitution and conditional assembly facilities at the  source
  652.        code level to virtually any assembler or cross assembler.
  653.     
  654.           MACRO reads the raw  assembler  source  from  one  or  more  files
  655.        specified as its arguments, and the processed assembler  source  file
  656.        is written to standard output where it  can  be  re-directed  into  a
  657.        temporary file for later assembly. All files specified  as  arguments
  658.        are  effectivly  concatinated  into  the  output  file  as  they  are
  659.        processed, providing a conveinent way  of  maintaining  large  single
  660.        source programs as more managable separate files.
  661.     
  662.           MACRO provides two types of macro definitions,  substitution,  and
  663.        instruction.
  664.     
  665.        3.1 Substitution macros
  666.     
  667.              Substitution macros may be used  anywhere  in  any  non-comment
  668.           line of the source file (lines not beginning with '*'),  and  when
  669.           encountered, are simply replaced by  the  text  specified  in  the
  670.           macro definition.
  671.     
  672.              Substitution macro's are defined using the 'SET' directive.  If
  673.           the macro definition text contains spaces,  tabs,  or  commas,  it
  674.           must be enclosed in double quote's.
  675.     
  676.              The following are examples of substitution macro definitions:
  677.     
  678.              sub1 set this_gets_substituted
  679.              sub2 set "this gets substituted"
  680.     
  681.              Substitution macros are only recognized of they are  surrounded
  682.           by non-alphanumeric characters. This prevents  substitutions  from
  683.           occuring within other words which may contain the pattern. It does
  684.           however require the restriction that the macro names contain  only
  685.           alphanumeric characters.
  686.     
  687.           3.1.1 Command line substitutions
  688.     
  689.                 Substitution macros may also be defined on the command  line
  690.              with arguments of the form "<symbol>=<string>".
  691.     
  692.          eg: 'macro source_file1 source_file2 mode=debug >output_file'
  693.     XASM Cross Assemblers                                            Page: 16
  694.  
  695.  
  696.        3.2 Instruction macros
  697.     
  698.              Instruction macros may only be used in the instruction field of
  699.           the source file, and when encountered, are replaced by one or more
  700.           lines of assembly source code.
  701.     
  702.              Instruction macros may be passed operands in the operand  field
  703.           of the assembly source  code.  If  multiple  operands  are  to  be
  704.           passed, they should be separated from one another by commas. If  a
  705.           single operand must contain spaces, tabs, or commas, it should  be
  706.           enclosed in double quotes.
  707.     
  708.           3.2.1 Backslash commands
  709.     
  710.                 The backslash character '\' has special  meaning  within  an
  711.              instruction macro definition as follows:
  712.     
  713.         \n  - Substitute the <n>'th parameter from  the  macro  invocation
  714.               line. <n> may range from zero to  nine,  parameter  zero  is
  715.               considered to be the LABEL from that line, actual parameters
  716.               from the operand field begin with parameter one.
  717.     
  718.         \#  - Substitute the number of parameters passed.
  719.     
  720.         \$  - Substitute a unique number which the total number  of  macro
  721.               invocations to occur in this assembly so far. This is  often
  722.               used to create unique labels within the macro.
  723.     
  724.         \@n - Substitute a portion of the current date based on the digit
  725.               'n', as follows:
  726.     
  727.               \@1 - Day of month, 1 or 2 digits.
  728.               \@2 - Day of month, 2 digits.
  729.               \@3 - Month of year, 2 digits.
  730.               \@4 - Month of year in string form.
  731.               \@5 - Month of year in three character string form.
  732.               \@6 - Current year, 2 digits.
  733.               \@7 - Current hour, 2 digits.
  734.               \@8 - Current minite, 2 digits.
  735.               \@9 - Current second, 2 digits.
  736.     
  737.         NOTE: The time is recorded when MACRO is first invoked.
  738.     
  739.         \\  - Place a backslash character in the macro definition.
  740.     
  741.                 Instruction macros are defined with the MACRO directive, and
  742.              are ended with the ENDMAC directive.
  743.     XASM Cross Assemblers                                            Page: 17
  744.  
  745.  
  746.           3.2.2 Example instruction macro
  747.     
  748.                 The following is an example  of  a  instruction  type  macro
  749.              using 6809 assembly language:
  750.     
  751.             * MACRO TO PRINT A CHARACTER STRING
  752.             PRINT   MACRO
  753.             \0      PSHS    A,X         SAVE REGISTERS
  754.                     LDX     #LAB2\$     STRING TO PRINT
  755.              LAB1\$ LDA     ,X+         GET CHAR FROM STRING
  756.                     BEQ     LAB3\$      END, QUIT
  757.                     JSR     PRINTCHR    DISPLAY THE CHARACTER
  758.                     BRA     LAB1\$      GO BACK FOR NEXT
  759.              LAB2\$ FCCZ    "\1"        STRING TO PRINT
  760.              LAB3\$ PULS    A,X         RESTORE REGISTERS
  761.                     ENDMAC
  762.     
  763.        3.3 Macro directives
  764.     
  765.              MACRO suports the following directives, which may be placed  in
  766.           the assembler source file. Note that only substitution type macros
  767.           may be used as values in operands to MACRO  directives,  as  MACRO
  768.           has no knowlege of the labels and symbols used by the assembler.
  769.     
  770.              <name> SET <string>
  771.     
  772.                 The SET defines the substitution type macro  with  the  name
  773.              specified by <name> to have the  text  specified  by  <string>.
  774.              Double quotes may be used  if  <string>  is  to  contain  tabs,
  775.              spaces, or commas. If the macro being defined  already  exists,
  776.              it is re-defined with the new value.  <name>  should  begin  in
  777.              column one.
  778.     
  779.              <name> MACRO
  780.     
  781.                 The MACRO directive begins the definition of  a  instruction
  782.              type macro. All subsequent lines up to a ENDMAC  directive  are
  783.              included in the macro definition. These lines are  not  written
  784.              to the output file.
  785.     
  786.              ENDMAC
  787.     
  788.                 This  directive  terminates  an   instruction   type   macro
  789.              definition.
  790.     
  791.              IFEQ <string>,<string>
  792.     
  793.                 The IFEQ directive causes MACRO to process  and  output  all
  794.              subsequent lines up to an ELSE or ENDIF directive, only if  the
  795.              two argument strings match.
  796.     
  797.              IFNE <string>,<string>
  798.     
  799.                 The IFNE directive causes MACRO to process  and  output  all
  800.              subsequent lines up to an ELSE or ENDIF directive only  if  the
  801.              two argument strings do not match.
  802.     XASM Cross Assemblers                                            Page: 18
  803.  
  804.  
  805.              ELSE
  806.     
  807.                 The ELSE directive causes MACRO to process  and  output  all
  808.              subsequent  lines  up  to  and  ENDIF  directive  only  of  the
  809.              preceding IFEQ or IFNE directive failed.
  810.     
  811.              ENDIF
  812.     
  813.                 This directive marks the end of  a  section  of  conditional
  814.              assembly statements following a IFEQ, IFNE, or ELSE directive.
  815.     
  816.              INCLUDE "<filename>"
  817.     
  818.                 The contents of the  specified  file  are  included  in  the
  819.              output file at the point where the  INCLUDE  directive  occurs.
  820.              Macro processing is performed on the included file.
  821.     
  822.              ABORT "<text>"
  823.     
  824.                 Causes MACRO  to  terminate,  displaying  an  error  message
  825.              containing the specified text.
  826.     XASM Cross Assemblers                                            Page: 19
  827.  
  828.  
  829.     4. HEX FILE FORMAT UTILITY
  830.     
  831.           The  HEXFMT  utility  provides  several   useful   functions   for
  832.        manipulating the HEX output files, usually  before  programming  them
  833.        into a ROM. It can also translate from MOTOROLA to INTEL format,  and
  834.        change the record size, padding etc. of the output file.
  835.     
  836.           The available options to HEXFMT are:
  837.     
  838.             -b                  - Output file in BINARY format
  839.             b=value             - Identify BASE address of HEX file
  840.             c=value,value,value - Calculate checksum
  841.             d=value             - Set default byte value
  842.             f=value             - Maximum number of consecutive FF's
  843.             -i                  - Output file in INTEL format
  844.             l=value             - Set output file load address
  845.             -m                  - Output file in MOTOROLA format
  846.             -q                  - Quiet, Inhibit progress messages
  847.             r=value             - Set size (in bytes) of output records
  848.             s=value             - Set size (in bytes) of target ROM
  849.             -w                  - Do not write output file
  850.             w=filename          - Write to this file
  851.     
  852.           Anywhere a 'value' is used, it may be  specified  in  any  of  the
  853.        following formats:
  854.     
  855.             nnnnn               - Decimal number        (0 - 65535)
  856.             $xxxx               - Hexidecimal number    ($0-$FFFF)
  857.             @oooooo             - Octal number          (@0-@177777)
  858.             %bbbbbbbbbbbbbbbb   - Binary number (%0-%1111111111111111)
  859.     
  860.        4.1 Input file
  861.     
  862.              HEXFMT reads its input file in either  MOTOROLA  or  INTEL  hex
  863.           format (Such as is produced by the cross assemeblers), and  builds
  864.           a memory image of the ROM which is to be produced.
  865.     
  866.              The 's=' option specifies the size (in bytes) of the ROM  image
  867.           (default 8192).
  868.     
  869.              The 'b=' option specifies the base  (starting)  address  to  be
  870.           assumed for the ROM image (default is addres in first record).
  871.     
  872.              The 'd=' option specifies the value which is to be assumed  for
  873.           all locations in the ROM image which are not loaded from the input
  874.           file (default is $FF).
  875.     XASM Cross Assemblers                                            Page: 20
  876.  
  877.  
  878.        4.2 Output file
  879.     
  880.              Unless told otherwise, HEXFMT will write the data back  to  the
  881.           same file it came from in the same format (MOTOROLA or  INTEL)  in
  882.           which it was read.
  883.     
  884.              The '-w' options tells HEXFMT not to write an output  file,  it
  885.           is useful if you simply want to know the  checksum  of  the  input
  886.           file.
  887.     
  888.              The 'w=' option may be used to specify a different output file.
  889.     
  890.              The 'r=' option may be used to tell HEXFMT how  many  bytes  to
  891.           place in each output file record (default is 32).
  892.     
  893.              The 'l=' option tells HEXFMT the beginning load address for the
  894.           output file records (default is Base address of input file).
  895.     
  896.              The  'm='  option  tells  HEXFMT  how  many   consecutive   $FF
  897.           characters to allow in the output file before  breaking  the  load
  898.           address sequence (default is 5). Most EPROM's assume the $FF value
  899.           when in  the  blank  state,  and  therefore  do  not  need  to  be
  900.           programmed with this value.  Eliminating  consecutive  $FF  values
  901.           from the load file will reduce the output file size  and  download
  902.           time.
  903.     
  904.              The '-i' and '-m' options may be used to force HEXFMT to output
  905.           the file in INTEL or MOTOROLA hex format, regardless of the  input
  906.           format. The '-b' option causes HEXFMT to write the file in  BINARY
  907.           form. When this is done, the output file will be an  exact  binary
  908.           (8 bit) image of the target ROM.
  909.     XASM Cross Assemblers                                            Page: 21
  910.  
  911.  
  912.        4.3 Checksumming
  913.     
  914.              The 'c=' option may be used to cause HEXFMT to calculate  a  16
  915.           bit checksum for a section of the ROM, and place it at a specified
  916.           location. The format of the 'c=' option is:
  917.     
  918.                             c=start,end,destination
  919.     
  920.              HEXFMT will calculate a checksum, which consists of the 16  bit
  921.           sum of all byte (8 bit  values)  between  the  'start'  and  'end'
  922.           addresses specified (inclusive). This 16 bit value is then  stored
  923.           at the indicated 'destination' address.
  924.     
  925.              NOTE: The  start,  end  and  destination  addresses  are  given
  926.           relative to the beginning of the image.  ie:  0000  is  the  first
  927.           address in the ROM.
  928.     
  929.              For example, To calculate the checksum of  an  8K  (8192  byte)
  930.           ROM, beginning at the second location, and proceeding to  the  end
  931.           of the ROM, storing this value at location 0000 in  the  ROM,  you
  932.           would use:
  933.     
  934.                               c=2,8191,0 (decimal)
  935.                                        or
  936.                            c=$0002,$1fff,$0000 (hex)
  937.     
  938.              The firmware in the ROM could then test the  integrity  of  the
  939.           ROM using code similar to this (for 6809):
  940.     
  941.             * ROUTINE TO TEST ROM CHECKSUM
  942.                     LDD     #0              BEGIN WITH ZERO VALUE
  943.                     LDX     #ROM+2          POINT TO SECOND BYTE OF ROM
  944.             LOOP    ADDB    ,X+             ADD 8 BIT VALUE...
  945.                     ADCA    #0              TO 16 BIT COUNTER
  946.                     CMPX    #ROM+8192       ARE WE FINISHED (AT END)?
  947.                     BNE     LOOP            NO, KEEP GOING
  948.                     CMPD    >ROM            IS CHECKSUM OK?
  949.                     BNE     CKFAIL          NO, REPORT ROM ERROR
  950.     
  951.              Up to ten (10) 'c=' options may be specified in a single HEXFMT
  952.           command, and each checksum will be calculated and stored  (in  the
  953.           order in which they occur in the command line).
  954.     
  955.              HEXFMT will also display (but not store) the checksum  for  the
  956.           entire ROM image, calculated in the above manner.
  957.     XASM Cross Assemblers                                            Page: 22
  958.  
  959.  
  960.     5. CROSS REFERENCE UTILITY
  961.     
  962.           CREF is a utility program which will generate  a  cross  reference
  963.        listing for an assembly source program. The output  listing  contains
  964.        at least one line for each symbol defined in  the  source  file,  the
  965.        line where it is defined, and the line numbers of all  references  to
  966.        it.
  967.     
  968.           The output listing is written to standard output where it  may  be
  969.        re-directed to a file or printer.
  970.     
  971.        5.1 Using CREF
  972.     
  973.              The format of the CREF command is:
  974.     
  975.           CREF input_file [d=symbol... p=char -q w=value] >output_file
  976.     
  977.              CREF normally does not report references to symbols  which  are
  978.           not defined in the source file. This prevents CREF from  reporting
  979.           accesses to processor registers in the output  listing.  The  'd='
  980.           option allows you to define additional symbols (such as  processor
  981.           registers) which will then be reported. Multiple 'd=' options  may
  982.           be used to define several additional symbols.
  983.     
  984.              The '-Q' option causes  CREF  to  be  quiet,  and  not  display
  985.           progress messages.
  986.     
  987.              The 'p=' option specifies a prefix character  which  identifies
  988.           temporary symbols. Any symbol which  begins  with  this  character
  989.           will not be displayed in the cross reference listing.
  990.     
  991.              The 'w=' option allows you to specify the width of  the  output
  992.           file (or device). The default value assumed if this option is  not
  993.           used is 80 characters.
  994.     XASM Cross Assemblers                                            Page: 23
  995.  
  996.  
  997.     6. PORTING SOURCE GENERATOR
  998.     
  999.           The PSOURCE utility is used to generate a 'porting'  source  file.
  1000.        This is useful if you want to give someone the  ability  to  assemble
  1001.        your programs without giving them the actual source code. This  might
  1002.        be the case  when  someone  is  "porting"  your  program  to  another
  1003.        computer  with  the  same  CPU  but  a  different  operating   system
  1004.        environment.
  1005.     
  1006.           PSOURCE makes a source file which is purposely difficult to  read.
  1007.        It  accomplishes  this  by  removing  all  comments,  converting  all
  1008.        occurances of blanks or tabs not contained within quotes to a  single
  1009.        space, and by changing all label names to meaningless  strings.  This
  1010.        gives an output file which is only slightly better than a disassembly
  1011.        of your program, but will assemble without error.
  1012.     
  1013.        6.1 Using PSOURCE
  1014.     
  1015.              The format of the PSOURCE command is:
  1016.     
  1017.            psource input_file [-q -t k=symbol* K=file*] >output_file
  1018.     
  1019.              The '-q' option causes PSOURCE to be quiet, and not display its
  1020.           progress messages.
  1021.     
  1022.              The '-t'  option  causes  PSOURCE  to  use  TAB  characters  to
  1023.           separate the fields in the output files (instead of spaces).
  1024.     
  1025.              The 'k=' option allows you to specify label names which are  to
  1026.           be 'kept', and not changed to meanless strings. This allows you to
  1027.           retain the labels and equates which must  be  changed  during  the
  1028.           process of porting your software.
  1029.     
  1030.              Up to 50 'k=' operands may be specified, allowing you  to  keep
  1031.           up to 50 label names.
  1032.     
  1033.              The 'K=' option allows you to specify  a  file  containing  the
  1034.           names of symbols which are to be 'kept'. It has the same effect as
  1035.           entering a 'k=' option for each line of the file.
  1036.     
  1037.              Normally, PSOURCE removes any comments  (lines  beginning  with
  1038.           '*') from the output file. If you use ';' to begin a comment line,
  1039.           PSOURCE will convert it  to  '*'  (for  XASM  compatibility),  and
  1040.           include it in the output file.
  1041.     XASM Cross Assemblers                                            Page: 24
  1042.  
  1043.  
  1044.     7. SOURCE CONVERTERS
  1045.     
  1046.           All assemblers in the XASM package follow a generic syntax,  which
  1047.        is similar to the  syntax  of  "Motorola"  style  assemblers.  Little
  1048.        difficulty  is  encountered  when  transferring  code  to  and   from
  1049.        assemblers of this type.
  1050.     
  1051.           Exchanging XASM code with  assemblers  which  support  an  "Intel"
  1052.        style syntax can be a problem  however,  because  there  are  several
  1053.        major differences in syntax.
  1054.     
  1055.           The XASM  package  includes  two  small  utility  programs,  which
  1056.        perform most of the work necessary to convert "Intel"  style  sources
  1057.        to and from  the  "Motorola"  style  used  by  the  XASM  assemblers.
  1058.        INT2XASM reads an "Intel" style source program, and  converts  it  to
  1059.        XASM style, while XASM2INT reads XASM style source, and  converts  it
  1060.        to "Intel" style.
  1061.     
  1062.        7.1 Using INT2XASM
  1063.     
  1064.              The format of the INT2XASM command is:
  1065.     
  1066.                    INT2XASM input_file output_file <options>
  1067.     
  1068.              The contents of the  "Intel"  style  input_file  are  read  and
  1069.           written to the output file with several conversions to XASM style.
  1070.           The  following  options  may  be  used  to  inhibit  the   various
  1071.           conversions:
  1072.     
  1073.           -C - Inhibit conversion of comment lines  beginning  with  ';'  to
  1074.                begin with '*'.
  1075.     
  1076.           -L - Inhibit removal of trailing ':' from statement labels.
  1077.     
  1078.           -N - Inhibit conversion of  any  Binary,  Octal,  Decimal  or  Hex
  1079.                constants of the form "nB, (nO or nQ),  nD  and  nH"  to  the
  1080.                corresponding XASM equivalents "%n, @n, n and $n".
  1081.     
  1082.           -@ - Inhibit conversion of 8051 indirect references  of  the  form
  1083.                "@expression" to the XASM equivalent "[expression]".
  1084.     XASM Cross Assemblers                                            Page: 25
  1085.  
  1086.  
  1087.        7.2 Using XASM2INT
  1088.     
  1089.              The format of the XASM2INT command is:
  1090.     
  1091.                    XASM2INT input_file output_file <options>
  1092.     
  1093.              The contents of the XASM style input_file are read and  written
  1094.           to the output file with several conversions to "Intel" style.  The
  1095.           following options may be used to modify the conversions:
  1096.     
  1097.           B= H= O= - These options tell XASM2INT what characters to  use  as
  1098.                suffix's for Binary, Hex and  Octal  constants.  (Default  is
  1099.                B=B, H=H, O=Q).
  1100.     
  1101.           L= - Defines a  character  to  be  appended  to  statement  labels
  1102.                (Default is ':').
  1103.     
  1104.           K= - Specifies the character which  is  recognized  as  a  comment
  1105.                delimiter (default is ';'). Any lines beginning with '*'  are
  1106.                converted to this character. Also, this character is inserted
  1107.                before any non-space character which occurs after the  column
  1108.                defined by (C=).
  1109.     
  1110.           C= - Defines a column number after which text  is  assumed  to  be
  1111.                comments (default is  32).  Any  non-space  characters  found
  1112.                after this column will  be  preceeded  by  the  (K=)  comment
  1113.                character.
  1114.     
  1115.           T= - Defines the size of TAB stops in the input file  (default  is
  1116.                8). This information is used to determine the column numbers.
  1117.     
  1118.           -@ - Inhibit  the  conversion  of  8051  references  of  the  form
  1119.                "[expression]" to "@expression".
  1120.     XASM Cross Assemblers                                            Page: 26
  1121.  
  1122.  
  1123.     8. APPENDICES
  1124.     
  1125.        8.1 Object file formats
  1126.     
  1127.              Object files are produced by the assemblers in  either  of  two
  1128.           standard formats, both of  which  represent  the  binary  data  as
  1129.           two-digit printable ASCII hex numbers. The exact contents  of  the
  1130.           two standard format object files is as follows:
  1131.     
  1132.     8.1.1 Motorola hex format
  1133.     
  1134.     Data Record: 'Stnnaaaadddddddddddddddddddddddddddddddd...cc'
  1135.           Where:  S = 'S', indicates start of data record
  1136.                   t = Record type, '1'=data, '9'=end of file.
  1137.                   n = Count of number of bytes in record.   (in ASCII/HEX)
  1138.                   a = Load address of data record.          (in ASCII/HEX)
  1139.                   d = Actual data bytes in record.          (in ASCII/HEX)
  1140.                   c = Checksum of count, address, and data. (in ASCII/HEX)
  1141.     
  1142.                 Note1: Checksum is computed as one's complement of eight
  1143.                        bit sum of all values fron 'nn' to end of data.
  1144.     
  1145.                 Note2: Count 'nn' is three greater then the number of data
  1146.                        bytes in the record.
  1147.     
  1148.     8.1.2 Intel hex format
  1149.     
  1150.     Data Record: ':nnaaaattdddddddddddddddddddddddddddddd...cc'
  1151.           Where:  : = Indicates start of data record
  1152.                   n = Count of number of bytes in record.   (in ASCII/HEX)
  1153.                   a = Load address of data record.          (in ASCII/HEX)
  1154.                   t = Record type                (00=Data, 01=End of file)
  1155.                   d = Actual data bytes in record           (in ASCII/HEX)
  1156.                   c = Checksum of count, address, and data. (in ASCII/HEX)
  1157.     
  1158.                 Note1: Checksum is computed as two's complement of eight
  1159.                        bit sum of all values fron 'nn' to end of data.
  1160.     
  1161.                 Note2: End of file record contains count of 00.
  1162.     XASM Cross Assemblers                                            Page: 27
  1163.  
  1164.  
  1165.     8.2 ASCII code chart
  1166.     
  1167.     
  1168.     
  1169.     
  1170.     
  1171.                              Most Significant Figure
  1172.     
  1173.               HEX||  0  |  1  |  2  |  3  |  4  |  5  |  6  |  7  |
  1174.               ===++=====+=====+=====+=====+=====+=====+=====+=====+
  1175.                0 || NUL | DLE |     |  0  |  @  |  P  |  `  |  p  |
  1176.               ---++-----+-----+-----+-----+-----+-----+-----+-----+
  1177.                1 || SOH | DC1 |  !  |  1  |  A  |  Q  |  a  |  q  |
  1178.           L   ---++-----+-----+-----+-----+-----+-----+-----+-----+
  1179.           e    2 || STX | DC2 |  "  |  2  |  B  |  R  |  b  |  r  |
  1180.           a   ---++-----+-----+-----+-----+-----+-----+-----+-----+
  1181.           s    3 || ETX | DC3 |  #  |  3  |  C  |  S  |  c  |  s  |
  1182.           t   ---++-----+-----+-----+-----+-----+-----+-----+-----+
  1183.                4 || EOT | DC4 |  $  |  4  |  D  |  T  |  d  |  t  |
  1184.           S   ---++-----+-----+-----+-----+-----+-----+-----+-----+
  1185.           i    5 || ENQ | NAK |  %  |  5  |  E  |  U  |  e  |  u  |
  1186.           g   ---++-----+-----+-----+-----+-----+-----+-----+-----+
  1187.           n    6 || ACK | SYN |  &  |  6  |  F  |  V  |  f  |  v  |
  1188.           i   ---++-----+-----+-----+-----+-----+-----+-----+-----+
  1189.           f    7 || BEL | ETB |  '  |  7  |  G  |  W  |  g  |  w  |
  1190.           i   ---++-----+-----+-----+-----+-----+-----+-----+-----+
  1191.           c    8 || BS  | CAN |  (  |  8  |  H  |  X  |  h  |  x  |
  1192.           a   ---++-----+-----+-----+-----+-----+-----+-----+-----+
  1193.           n    9 || HT  | EM  |  )  |  9  |  I  |  Y  |  i  |  y  |
  1194.           t   ---++-----+-----+-----+-----+-----+-----+-----+-----+
  1195.                A || LF  | SUB |  *  |  :  |  J  |  Z  |  j  |  z  |
  1196.           F   ---++-----+-----+-----+-----+-----+-----+-----+-----+
  1197.           i    B || VT  | ESC |  +  |  ;  |  K  |  [  |  k  |  {  |
  1198.           g   ---++-----+-----+-----+-----+-----+-----+-----+-----+
  1199.           u    C || FF  | FS  |  ,  |  <  |  L  |  \  |  l  |  |  |
  1200.           r   ---++-----+-----+-----+-----+-----+-----+-----+-----+
  1201.           e    D || CR  | GS  |  -  |  =  |  M  |  ]  |  m  |  }  |
  1202.               ---++-----+-----+-----+-----+-----+-----+-----+-----+
  1203.                E || SO  | RS  |  .  |  >  |  N  |  ^  |  n  |  ~  |
  1204.               ---++-----+-----+-----+-----+-----+-----+-----+-----+
  1205.                F || SI  | US  |  /  |  ?  |  O  |  _  |  o  | DEL |
  1206.               ---++-----+-----+-----+-----+-----+-----+-----+-----+
  1207.  
  1208.  
  1209.  
  1210.                              XASM Cross Assemblers
  1211.  
  1212.                                TABLE OF CONTENTS
  1213.  
  1214.  
  1215.                                                                          Page
  1216.  
  1217.      1. INTRODUCTION                                                        1
  1218.  
  1219.  
  1220.      2. ASSEMBLERS                                                          2
  1221.  
  1222.         2.1 Using the assemblers                                            2
  1223.         2.2 Redirecting the listing file                                    4
  1224.         2.3 Source file format                                              4
  1225.         2.4 Expressions                                                     5
  1226.         2.5 Addressing Modes                                                6
  1227.         2.6 Assembler directives                                            8
  1228.         2.7 Error Messages                                                 12
  1229.         2.8 Error message summary                                          13
  1230.         2.9 Additional notes on ASM86                                      14
  1231.  
  1232.      3. MACRO PREPROCESSOR                                                 15
  1233.  
  1234.         3.1 Substitution macros                                            15
  1235.         3.2 Instruction macros                                             16
  1236.         3.3 Macro directives                                               17
  1237.  
  1238.      4. HEX FILE FORMAT UTILITY                                            19
  1239.  
  1240.         4.1 Input file                                                     19
  1241.         4.2 Output file                                                    20
  1242.         4.3 Checksumming                                                   21
  1243.  
  1244.      5. CROSS REFERENCE UTILITY                                            22
  1245.  
  1246.         5.1 Using CREF                                                     22
  1247.  
  1248.      6. PORTING SOURCE GENERATOR                                           23
  1249.  
  1250.         6.1 Using PSOURCE                                                  23
  1251.  
  1252.      7. SOURCE CONVERTERS                                                  24
  1253.  
  1254.         7.1 Using INT2XASM                                                 24
  1255.         7.2 Using XASM2INT                                                 25
  1256.  
  1257.      8. APPENDICES                                                         26
  1258.  
  1259.         8.1 Object file formats                                            26
  1260.         8.2 ASCII code chart                                               27
  1261.